Learn R Programming

popdemo (version 0.2-3)

is.matrix_primitive : Determine primitivity of a matrix

Description

Determine whether a matrix is primitive or imprimitive

Usage

is.matrix_primitive(A)

Arguments

A
a square, non-negative numeric matrix of any dimension.

Value

TRUE (for an primitive matrix) or FALSE (for an imprimitive matrix).

Details

is.matrix_primitive works on the premise that a matrix A is primitive if A raised to the power of s^2-(2*s)+2 is positive, where s is the dimension of A (see Caswell 2001).

References

Caswell (2001) matrix Population Models, 2nd. ed. Sinauer.

See Also

is.matrix_irreducible, is.matrix_ergodic.

Examples

Run this code
    # Create a 3x3 primitive PPM
    A <- matrix(c(0,1,2,0.5,0,0,0,0.6,0), byrow=TRUE, ncol=3)
    A

    # Diagnose primitivity
    is.matrix_primitive(A)

    # Create a 3x3 imprimitive PPM
    B<-A
    B[1,2] <- 0
    B

    # Diagnose primitivity
    is.matrix_primitive(B)

Run the code above in your browser using DataLab